﻿using SkiaSharp;
using System.Text.Json.Serialization;
namespace DaqConfigureTool
{
    public struct DaqColor(byte r, byte g, byte b, byte a = 255)
    {
        [JsonPropertyName("r")]
        public byte R { get; set; } = r;
        [JsonPropertyName("g")]
        public byte G { get; set; } = g;
        [JsonPropertyName("b")]
        public byte B { get; set; } = b;
        [JsonPropertyName("a")]
        public byte A { get; set; } = a;
        public override readonly string ToString() => $"#{A:X2}{R:X2}{G:X2}{B:X2}";

        public SKColor ToSKColor()
        {
            return new SKColor(R, G, B, A);
        }
    }
}